package com.shuhe.domain.mxgc;

public class DbTableBean {

    private String column_name;
    private String ordinal_position;
    private String column_comment;
    private String data_type;
    private String character_maximum_length;
    private String numeric_precision;  //number总长度
    private String numeric_scale;  //numbber小数位数
    private String column_length;


    public String getColumn_length() {
        if (column_length == null || column_length.trim().equals("")){
            return getCharacter_maximum_length();
        }
        return column_length;
    }

    public void setColumn_length(String column_length) {
        this.column_length = column_length;
    }

    public String getNumeric_scale() {
        if (numeric_scale == null){
            return "0";
        }

        return numeric_scale;
    }

    public void setNumeric_scale(String numeric_scale) {
        if (numeric_scale != null){
            if (numeric_scale.contains(".")){
                numeric_scale = numeric_scale.split("\\.")[0];
            }
        }
        this.numeric_scale = numeric_scale;
    }

    public String getNumeric_precision() {
        if (numeric_precision == null){
            return "0";
        }
        return numeric_precision;
    }

    public void setNumeric_precision(String numeric_precision) {
        if (numeric_precision != null){
            if (numeric_precision.contains(".")){
                numeric_precision = numeric_precision.split("\\.")[0];
            }
        }
        this.numeric_precision = numeric_precision;
    }

    public String getCharacter_maximum_length() {
        if (character_maximum_length == null){
            return "50";
        }
        return character_maximum_length;
    }

    public void setCharacter_maximum_length(String character_maximum_length) {
        this.character_maximum_length = character_maximum_length;
    }

    public String getData_type() {
        return data_type;
    }

    public void setData_type(String data_type) {
        this.data_type = data_type;
    }

    public String getColumn_comment() {
        return column_comment;
    }

    public void setColumn_comment(String column_comment) {
        this.column_comment = column_comment;
    }

    public String getColumn_name() {
        return column_name;
    }

    public void setColumn_name(String column_name) {
        this.column_name = column_name;
    }

    public String getOrdinal_position() {
        return ordinal_position;
    }

    public void setOrdinal_position(String ordinal_position) {
        this.ordinal_position = ordinal_position;
    }

}
